/* eisenstein-OS */

#ifndef _STDINT_H
#include <stdint.h>
#endif /* stdint.h */

#ifndef VIDEO_H
#define VIDEO_H

#define ADDRESS_VIDEO 0xb8000

#define ROWS_MAX 25
#define COLS_MAX 80

#define FONT_DEFAULT 0x0f

#define COLOR_BLACK		      0x0
#define COLOR_BLUE		      0x1
#define COLOR_GREEN		      0x2
#define COLOR_CYAN		      0x3
#define COLOR_RED		        0x4
#define COLOR_MAGENTA		    0x5
#define COLOR_BROWN		      0x6
#define COLOR_LIGHT_GREY    0x7
#define COLOR_DARK_GREY     0x8
#define COLOR_LIGHT_BLUE    0x9
#define COLOR_LIGHT_GREEN   0xA
#define COLOR_LIGHT_CYAN    0xB
#define COLOR_LIGHT_RED     0xC
#define COLOR_LIGHT_MAGENTA 0xD	
#define COLOR_LIGHT_BROWN   0xE
#define COLOR_WHITE         0xF

#define font_create(fg, bg)  ((fg) | (bg << 4))
#define char_entry(attb, charb)  ((charb) | (attb << 8))
#define get_screen_offset(row, col)  (((row * COLS_MAX) + col) * 2)

#define REG_SCREEN_CTRL 0x3d4
#define REG_SCREEN_DATA 0x3d5

extern void clear_screen();
extern uint16_t get_cursor();
extern void set_cursor(uint16_t offset);
extern void print_char(char character, uint8_t type, int row, int col);
extern void print_string(char* str, uint8_t type, int row, int col);
#endif /* video.h */
